<template>
  <div>
    <p>{{ count }}</p>
    <hr/>
    <p>{{ doubleCount }}</p>
    <hr/>
    <p>{{ state }}</p>
    <p>{{ isReady }} ------ {{ isLoading }}</p>
  </div>
</template>

<script setup>
import { useAsyncState } from '@vueuse/core'
import { useGlobalState } from '@/views/42.vueUse库/store/index.js'
import axios from 'axios'

const { count, doubleCount } = useGlobalState()
const { state, isReady, isLoading } = useAsyncState(
  axios.get('https://jsonplaceholder.typicode.com/todos/1').then((t) => t.data)
)
</script>
